from django.conf.urls import url, include
from rest_framework import routers
from users.views import user_login, user_logout, user_register, \
    UserLogin, UserViewSet, UserTokenViewSet, check_username, active, login_check

router = routers.DefaultRouter()
# router.register('users', UserView)
router.register('users', UserViewSet)
router.register('token', UserTokenViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^login$', user_login, name='user_login'),
    url(r'^logout', user_logout, name='user_logout'),
    url(r'^register', user_register, name='user_register'),
    url(r'^user', UserLogin.as_view(), name='User_login'),
    url(r'^check', check_username),
    url(r'^login_check$', login_check),
    url(r'^active/(?P<token>.*)$', active, name='active'),
]
